package com.example.calculation;


import com.example.entity.Recipe;

public class PlayRecipe implements Cloneable{


    //菜谱的id
    protected long id;

    protected Recipe recipe;

    protected int count;

    //单份价格(专精，技法，大赛倍数，厨具等全部算完之后)
    protected  double singeprice;

    //最终总价格
    protected double totalprice;


    public PlayRecipe(Recipe recipe,int count){
        this.recipe=recipe;
        this.count=count;
        this.id=recipe.getRecipeId();
    }

    @Override
    public PlayRecipe clone() {
        PlayRecipe old = null;
        try {
            old = (PlayRecipe) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return old;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public Recipe getRecipe() {
        return recipe;
    }

    public void setRecipe(Recipe recipe) {
        this.recipe = recipe;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public double getSingeprice() {
        return singeprice;
    }

    public void setSingeprice(double singeprice) {
        this.singeprice = singeprice;
    }

    public double getTotalprice() {
        return totalprice;
    }

    public void setTotalprice(double totalprice) {
        this.totalprice = totalprice;
    }


    @Override
    public String toString() {
        return "{" +
                "\"recipe\" : \"" + recipe.getName() +"\""+
                ", \"count\" :" + count +
                '}';
    }
}

